package com.mapforge.filechooser;

import java.io.File;

import com.mapforge.util.FileUtil;

public class ImageFileFilter extends SpecificExtensionFileFilter {

	public ImageFileFilter() {
		super("Java Supported Image Files", new String[] { "png", "jpg",
				"jpeg", "bmp", "tif", "tiff", "gif" });
	}

	public static boolean hasImageExtension(File f) {
		String s = FileUtil.getExt(f).toLowerCase();
		return s.equalsIgnoreCase("png") || s.equalsIgnoreCase("jpg")
				|| s.equalsIgnoreCase("bmp") || s.equalsIgnoreCase("jpeg")
				|| s.equalsIgnoreCase("tif") || s.equalsIgnoreCase("tiff")
				|| s.equalsIgnoreCase("gif");
	}
}
